from typing import TypeVar

from sqlalchemy.orm import Mapped, mapped_column, relationship

from recruit.adapter.database.models.base import AbstractResume

Resume = TypeVar('Resume')


class ResumeEducation(AbstractResume):
    """ Model ResumeEducation. """
    year: Mapped[int] = mapped_column(comment='Год')
    education_institution: Mapped[str] = mapped_column(
        comment='Учебное заведение'
    )
    faculty: Mapped[str] = mapped_column(comment='Факультет')
    specialization: Mapped[str] = mapped_column(comment='Специализация')
    graduation_year: Mapped[int] = mapped_column(comment='Год окончания')
    resume: Mapped['Resume'] = relationship(
        back_populates='resume_education',
        lazy='selectin'
    )
